    <% form_tag({:action => 'update', :id => @user}, :multipart => true) do %>
        <% if flash[:notice] %>
    	<div class="green flash">
		    <div class="start"></div>
		    <div class="notice"><%= flash[:notice]%></div>
		    <div class="end"></div>
		    <div class="clear"></div>
    	</div>
    	<% end %>
    	<% if flash[:error] %>
		<div class="red flash">
	    	<div class="start"></div>
	        <div class="notice"><%= flash[:error] %></div>
	        <div class="end"></div>
	        <div class="clear"></div>
	    </div>
	    <% end %>
    	<%= error_messages_for 'user' %>
        <table class="form" cellpadding="0px" cellspacing="0px">
        	<tr>
				<th colspan="2">Please upload a 50X50 image whose size is less than 32KB (32768 bytes).</th>
			</tr>
			<tr>
			    <td class="labels" rowspan="2">
			        <label for="photo">
			            Your Avatar
			        </label>
			    </td>
			    <td class="fields">
			    	<% if @avatar_url %>
			        <img src="<%= @avatar_url %>" width="50px" height="50px" />
			        <% end %>
			    </td>
			</tr>
			<tr>
			    <td class="fields">
			        <%= file_field 'photo', 'photo', {:class => 'normal_input_width'} %>
			    </td>
			</tr>
			<tr class="breaker">
				<td colspan="2">
					Your login info
				</td>
			</tr>
			<tr>
			    <td class="labels">
			        <label for="login_name">
			            Login Name
			        </label>
			    </td>
			    <td class="fields">
			        <%= text_field 'user', 'login_name', {:class => 'normal_input_width'} %>
			    </td>
			</tr>
			<tr>
			    <td class="labels">
			        <label for="email">
			            Email
			        </label>
			    </td>
			    <td class="fields">
			        <%= text_field 'user', 'email', {:class => 'normal_input_width'} %>
			    </td>
			</tr>
			<tr class="breaker">
				<td colspan="2">
					Your name
				</td>
			</tr>
			<tr>
			    <td class="labels">
			        <label for="first_name">
			            First Name
			        </label>
			    </td>
			    <td class="fields">
			        <%= text_field 'user', 'first_name', {:class => 'normal_input_width'} %>
			    </td>
			</tr>
			<tr>
			    <td class="labels">
			        <label for="last_name">
			            Last Name
			        </label>
			    </td>
			    <td class="fields">
			        <%= text_field 'user', 'last_name', {:class => 'normal_input_width'} %>
			    </td>
			</tr>
			<tr class="button_area">
        		<td colspan="2"><%=submit_tag ' Update ', :disable_with => 'Updating ...', :class => 'submit' %></td>
        	</tr>
		</table>
    <%end %>

<%content_for(:left_header) do%>
You're editing your profile. | <%= link_to '<b>Change Password</b>', :action => 'change_password' %>
<% end %>


